<?php
final class Controller_News extends Controller_Right{
    protected function Acquiescent(){
        #横幅
        $this->BindBanner();
        #数据
        $data=Database::GetRows('select * from app_news order by ID desc',array(
            'CurrentPage'=>Route::GetArguments('page'),
            'PageSize'=>15
        ));
        Template::Assign('Data',$data);
        Template::Display('news.html');
    }

    protected function Show(){
        #横幅
        $this->BindBanner();
        #数据
        $id=Route::GetArguments('id');
        $data=Database::GetRowByValue('app_news','ID',$id);
        $data['Content']=stripslashes($data['Content']);
        Template::Assign('Data',$data);
        Template::Display('news_show.html');
    }

    protected function BindBanner(){
        $data=Database::GetRowByValue('app_image','ID','7');
        Template::Assign('Banner',$data['Path']);
    }
}
?>